<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreatePostsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('posts', function(Blueprint $table)
		{
			$table->increments('id');
			$table->integer('category_id')->unsigned()->nullable()->index('cat_id');
			$table->string('article_attrs', 1)->nullable()->comment('属性');
			$table->boolean('use_link')->default(1)->comment('1外部链接2系统链接');
			$table->string('link', 600)->nullable();
			$table->integer('sort')->default(50)->comment('排序');
			$table->string('source')->nullable()->comment('来源');
			$table->string('post_title')->nullable();
			$table->string('digest')->nullable();
			$table->string('thumb')->nullable();
			$table->text('wx_content')->nullable();
			$table->text('content')->nullable();
			$table->text('file', 65535)->nullable();
			$table->string('tpl')->nullable();
			$table->boolean('status')->nullable()->comment('1：草稿 2：发布');
			$table->timestamps();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('posts');
	}

}
